<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/30
 * Time: 16:39
 */

namespace app\api\Model;

use think\Model;

class BaseModel extends Model
{
    //子类只能集成
    protected function prefixImgUrl($value, $data)
    {
        $finaUrl = $value;

        $finaUrl = config('setting.img_prefix') . $value;

        return $finaUrl;
    }

//    继承自动读取器配置url图片
    public function getUrlAttr($value, $data)
    {
        $finaUrl = $value;
        if ($data['from'] == 1) {
            $finaUrl = config('setting.img_prefix') . $value;
        }
        return $finaUrl;
    }

}